home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / strlibs.zip / MEMMOV.C < prev    next >
Text File  |  1993-01-04  |  862b  |  29 lines

  1.  
  2. /*  File   : memmov.c
  3.     Author : Richard A. O'Keefe.
  4.     Updated: 25 May 1984
  5.     Defines: memmov()
  6.  
  7.     memmov(dst, src, len)
  8.     moves len bytes from src to dst.  The result is dst+len.
  9.     This is to memcpy as str[n]mov is to str[n]cpy, that is, it moves
  10.     exactly the same bytes but returns a pointer to just after the
  11.     the last changed byte.  You can concatenate blocks pa for la,
  12.     pb for lb, pc for lc into area pd by doing
  13.         memmov(memmov(memmov(pd, pa, la), pb, lb), pc, lc);
  14.     Unlike strnmov, memmov does not stop when it hits a NUL byte.
  15.  
  16.     Note: the VAX assembly code version can only handle 0 <= len < 2^16.
  17.     It is presented for your interest and amusement.
  18. */
  19.  
  20. char *
  21. memmov(dst, src, len)
  22. register char *dst, *src;
  23. register int  len;
  24. {
  25.     while (--len >= 0) *dst++ = *src++;
  26.     return dst;
  27. }
  28.  
  29.